package com.injury.hunan.entity.biz.config;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.injury.hunan.common.utils.DateUtils;
import com.injury.hunan.entity.CommonEntity;
import com.injury.hunan.entity.annotation.Comment;
import com.injury.hunan.entity.annotation.HashCodeField;

@javax.persistence.Entity
@Table(name = "CATEGORY")
public class Category extends CommonEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -5967396260765631878L;

	@Id
	@Column(name = "CATE_CODE", length = 32)
	@Comment("类别编码")
	@HashCodeField
	private String cateCode;

	@Column(name = "cate_name", length = 60, nullable = false)
	@Comment("项目类别名称")
	@HashCodeField
	private String cateName;

	@Column(name = "cata_type", length = 5)
	private int cateType;

	@Column(name = "pyjm", length = 6)
	@Comment("拼音简码")
	private String pyjm;

	@Column(name = "wbjm", length = 6)
	@Comment("五笔简码")
	private String wbjm;

	@Column(name = "zdym", length = 6)
	@Comment("自定义吗")
	private String zdym;

	@Column(name = "orderid")
	@Comment("显示顺序")
	private int order;

	@Column(name = "modifier_name", length = 60)
	@Comment("修改者")
	private String modifier;

	@Column(name = "modifier_id", length = 32)
	@Comment("修改者ID")
	private String modifierID;

	@Column(name = "modify_date")
	@Temporal(TemporalType.TIMESTAMP)
	private Date modifyDate;

	/**
	 * @return the cateCode
	 */
	public String getCateCode() {
		return cateCode;
	}

	/**
	 * @param cateCode
	 *            the cateCode to set
	 */
	public void setCateCode(String cateCode) {
		this.cateCode = cateCode;
	}

	/**
	 * @return the cateName
	 */
	public String getCateName() {
		return cateName;
	}

	/**
	 * @param cateName
	 *            the cateName to set
	 */
	public void setCateName(String cateName) {
		this.cateName = cateName;
	}

	/**
	 * @return the cateType
	 */
	public int getCateType() {
		return cateType;
	}

	/**
	 * @param cateType
	 *            the cateType to set
	 */
	public void setCateType(int cateType) {
		this.cateType = cateType;
	}

	/**
	 * @return the pyjm
	 */
	public String getPyjm() {
		return pyjm;
	}

	/**
	 * @param pyjm
	 *            the pyjm to set
	 */
	public void setPyjm(String pyjm) {
		this.pyjm = pyjm;
	}

	/**
	 * @return the wbjm
	 */
	public String getWbjm() {
		return wbjm;
	}

	/**
	 * @param wbjm
	 *            the wbjm to set
	 */
	public void setWbjm(String wbjm) {
		this.wbjm = wbjm;
	}

	/**
	 * @return the zdym
	 */
	public String getZdym() {
		return zdym;
	}

	/**
	 * @param zdym
	 *            the zdym to set
	 */
	public void setZdym(String zdym) {
		this.zdym = zdym;
	}

	/**
	 * @return the order
	 */
	public int getOrder() {
		return order;
	}

	/**
	 * @param order
	 *            the order to set
	 */
	public void setOrder(int order) {
		this.order = order;
	}

	/**
	 * @return the modifier
	 */
	public String getModifier() {
		return modifier;
	}

	/**
	 * @param modifier
	 *            the modifier to set
	 */
	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	/**
	 * @return the modifierID
	 */
	public String getModifierID() {
		return modifierID;
	}

	/**
	 * @param modifierID
	 *            the modifierID to set
	 */
	public void setModifierID(String modifierID) {
		this.modifierID = modifierID;
	}

	/**
	 * @return the modifyDate
	 */
	public Date getModifyDate() {
		return modifyDate;
	}

	/**
	 * @param modifyDate
	 *            the modifyDate to set
	 */
	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}

	public Map<String, Object> toMap() {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("order", order);
		map.put("zdym", zdym);
		map.put("wbjm", wbjm);
		map.put("pyjm", pyjm);
		map.put("cateName", cateName);
		/* map.put("id", getId()); */
		map.put("cateCode", cateCode);
		map.put("cateType", cateType);
		map.put("modifyDate", DateUtils.format(modifyDate, "yyyy-MM-dd HH:mm:ss"));
		return map;
	}

}
